/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.uoc.tdp.pac4.beans;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * @author pguerreroj
 * CREATE TABLE Taller (
    ID integer NOT NULL,
    Cif character varying NOT NULL,
    adresa character varying NOT NULL,
    capacitat integer NOT NULL,
    capTaller integer,
    telefon character varying,
    web character varying,
    actiu boolean DEFAULT true NOT NULL,
    dataApertura date DEFAULT now() NOT NULL,
    dataModificacio date,
    dataBaixa date,
    CONSTRAINT ck_capacitat CHECK ((capacitat > 0))
);
 */


public class Taller implements Serializable {
    
    private static final long serialVersionUID = 1L;
    private int  id;
    private String nom;
    private String  cif;
    private String adresa;
    private int capacitat;
    private Usuari capTaller;
    private String telefon;
    private String web;
    private boolean actiu;
    private Date dataApertura;
    private Date dataModificacio;
    private Date dataBaixa;
    private boolean esborrat;
    
    public Taller() {
    }

    public Taller(int id, String nom, String Cif, String adresa, int capacitat, Usuari capTaller, String telefon, String web, boolean actiu) {
        this.id = id;
        this.nom = nom;
        this.cif = Cif;
        this.adresa = adresa;
        this.capacitat = capacitat;
        this.capTaller = capTaller;
        this.telefon = telefon;
        this.web = web;
        this.actiu = actiu;

        
    }

    public int getId() {
        return id;
    }

    public String getNom() {
        return nom;
    }

    public String getCif() {
        return cif;
    }

    public String getAdresa() {
        return adresa;
    }

    public int getCapacitat() {
        return capacitat;
    }

    public Usuari getCapTaller() {
        return capTaller;
    }

    public String getTelefon() {
        return telefon;
    }

    public String getWeb() {
        return web;
    }

    public boolean getActiu() {
        return actiu;
    }

    public Date getDataApertura() {
        return dataApertura;
    }

    public Date getDataModificacio() {
        return dataModificacio;
    }

    public Date getDataBaixa() {
        return dataBaixa;
    }

    public boolean getEsborrat() {
        return esborrat;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    
    public void setCif(String cif) {
        this.cif = cif;
    }

    public void setAdresa(String adresa) {
        this.adresa = adresa;
    }

    public void setCapacitat(int capacitat) {
        this.capacitat = capacitat;
    }

    public void setCapTaller(Usuari capTaller) {
        this.capTaller = capTaller;
    }

    public void setTelefon(String telefon) {
        this.telefon = telefon;
    }

    public void setWeb(String web) {
        this.web = web;
    }

    public void setActiu(boolean actiu) {
        this.actiu = actiu;
    }

    public void setDataApertura(Date dataApertura) {
        this.dataApertura = dataApertura;
    }

    public void setDataModificacio(Date dataModificacio) {
        this.dataModificacio = dataModificacio;
    }

    public void setDataBaixa(Date dataBaixa) {
        this.dataBaixa = dataBaixa;
    }

    public void setEsborrat(boolean esborrat) {
        this.esborrat = esborrat;
    }
    
    
    @Override
    public String toString(){
        return nom;
    }
    
     public String[] toTable() {
        String[] a = { Integer.toString(this.id), this.nom, this.telefon, Boolean.toString(this.actiu), Boolean.toString(this.esborrat) } ;
        
        return a;
    }
    
}
